/*
 * @Author: Jieeeny
 * @Date: 2023-04-25 14:32:43
 * @LastEditors: Jieeeny
 * @LastEditTime: 2023-11-23 11:44:37
 * @Description:
 * @FilePath: \vite-vue3-ts-pinia-vueuse\src\router\index.ts
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Index',
    redirect: '/mask',
    meta: {
      title: '首页',
      icon: 'Setting',
      keepAlive: true,
      requireAuth: true,
    },
    component: () => import('@/layouts/index.vue'),
    children: [
      {
        path: '/mask',
        name: 'Draggable',
        meta: {
          title: '拖拽',
          icon: 'Setting',
          keepAlive: true,
          requireAuth: false,
        },
        component: () => import('@/page/vueDraggable.vue'),
      },
      {
        path: '/form',
        name: 'Form',
        meta: {
          title: '渲染',
          icon: 'Setting',
          keepAlive: true,
          requireAuth: false,
        },
        component: () => import('@/page/renderForm.vue'),
      },
      {
        path: '/table',
        name: 'Table',
        meta: {
          title: '列表',
          icon: 'Setting',
          keepAlive: true,
          requireAuth: false,
        },
        component: () => import('@/page/tableList.vue'),
      },
      {
        path: '/vueUse',
        name: 'VueUse',
        meta: {
          title: 'vueUse',
          icon: 'Plus',
        },
        component: () => import('@/page/vueUse.vue'),
      },
      {
        path: '/render',
        name: 'Render',
        meta: {
          title: '渲染函数',
        },
        component: () => import('@/page/render.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});
export default router;
